Prometheus Service Installation Guide
This is the installation guide for On-Premise environments that want to use the system monitoring feature.
Overview
This document provides a guide for installing Prometheus using the kube-prometheus-stack Helm Chart.
※ From version 2025.09 of the OVA Virtual Appliance Baseline, Prometheus is installed as a standard specification.
If Prometheus is installed, you can enable system monitoring features with the following configmap settings.
(The method of direct installation differs from the namespace.)
### portal-web-config
VUE_APP_USE_SYSTEM_MONITORING: true
### cloud-spsvr-config
CUSTOM_PROMETHEUS_URL: http://rancher-monitoring-prometheus.monitoring.svc.cluster.local:9090
- List of services included in kube-prometheus-stack
| Service | Function | Required 여부 |
|---|---|---|
| prometheus | Cluster Metric Data Collection and Storage | ⭕️ |
| prometheus-config-reloader | Automatic Detection and Application of Prometheus Configuration | ⭕️ |
| prometheus-operator | Resource management and automation related to Prometheus | ⭕️ |
| prometheus-node-exporter | Providing Node System Resource Data (CPU, Memory, Disk, Network) | ⭕️ |
| kube-state-metrics | Provides resource status information operating in a Kubernetes cluster | ⭕️ |
| alertmanager | Sending alert emails and webhooks from Prometheus | ❌ |
| grafana | Visualizing data collected from Prometheus and providing it in the form of a dashboard. | ❌ |
Installation Method
-
Preparing the necessary Docker Image files
-
Docker Image Pull
# prometheus
docker pull quay.io/prometheus/prometheus:v3.2.1
# prometheus-operator
docker pull quay.io/prometheus-operator/prometheus-operator:v0.80.1
# prometheus-node-exporter
docker pull quay.io/prometheus/node-exporter:v1.9.0
# prometheus-config-reloader
docker pull rancher/mirrored-prometheus-operator-prometheus-config-reloader:v0.59.1
# kube-state-metrics
docker pull rancher/mirrored-kube-state-metrics-kube-state-metrics:v2.6.0 -
Changing Docker Image Tags via Harbor in a Closed Network Environment
# prometheus
docker tag quay.io/prometheus/prometheus:v3.2.1 harbor.local:5050/prometheus/prometheus:v3.2.1
# prometheus-operator
docker tag quay.io/prometheus-operator/prometheus-operator:v0.80.1 harbor.local:5050/prometheus/prometheus-operator:v0.80.1
# prometheus-node-exporter
docker tag quay.io/prometheus/node-exporter:v1.9.0 harbor.local:5050/prometheus/prometheus-node-exporter:v1.9.0
# prometheus-config-reloader
docker tag rancher/mirrored-prometheus-operator-prometheus-config-reloader:v0.59.1 harbor.local:5050/prometheus/prometheus-config-reloader:v0.59.1
# kube-state-metrics
docker tag rancher/mirrored-kube-state-metrics-kube-state-metrics:v2.6.0 harbor.local:5050/prometheus/kube-state-metrics:v2.6.0 -
Save Docker Image as .tar file
# prometheus
docker save -o prometheus.tar harbor.local:5050/prometheus/prometheus:v3.2.1
# prometheus-operator
docker save -o prometheus-operator.tar harbor.local:5050/prometheus/prometheus-operator:v0.80.1
# prometheus-node-exporter
docker save -o node-exporter.tar harbor.local:5050/prometheus/prometheus-node-exporter:v1.9.0
# prometheus-config-reloader
docker save -o prometheus-config-reloader.tar harbor.local:5050/prometheus/prometheus-config-reloader:v0.59.1
# kube-state-metrics
docker save -o kube-state-metrics.tar harbor.local:5050/prometheus/kube-state-metrics:v2.6.0
-
-
Preparing the kube-prometheus-stack Helm Chart
# helm 저장소 추가
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
# prometheus-operator-crds 다운로드
helm pull prometheus-community/prometheus-operator-crds
# kube-prometheus-stack chart 다운로드
helm pull prometheus-community/kube-prometheus-stack -
Modify the configuration values in the kube-prometheus-stack chart values.yaml file.
-
kube-prometheus-stack chart values.yaml
# values.yaml
fullnameOverride: "rancher-monitoring"
alertmanager:
enabled: false #사용 안함
grafana:
enabled: false #사용 안함
kubeApiServer:
enabled: false #사용 안함
kubeControllerManager:
enabled: false #사용 안함
coreDns:
enabled: false #사용 안함
kubeEtcd:
enabled: false #사용 안함
kubeScheduler:
enabled: false #사용 안함
kubeProxy:
enabled: false #사용 안함
prometheusOperator:
image:
registry: harbor.local:5050 #로컬 Harbor 주소로 변경 필요
repository: prometheus/prometheus-operator
tag: "v0.80.1"
prometheusConfigReloader:
image:
registry: harbor.local:5050 #로컬 Harbor 주소로 변경 필요
repository: prometheus/prometheus-config-reloader
tag: "v0.59.1"
prometheus:
prometheusSpec:
scrapeInterval: "60s"
evaluationInterval: "60s"
retention: 10d #데이터 보관 주기기
image:
registry: harbor.local:5050 #로컬 Harbor 주소로 변경 필요
repository: prometheus/prometheus
tag: v3.2.1
volumeClaimTemplate: #PVC 설정
spec:
storageClassName: longhorn
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 10Gi -
prometheus-node-exporter subchart values.yaml
# charts\prometheus-node-exporter\values.yaml
image:
registry: harbor.local:5050 #로컬 Harbor 주소로 변경 필요
repository: prometheus/prometheus-node-exporter
tag: "v1.9.0" -
kube-state-metrics subchart values.yaml
# charts\kube-state-metrics\values.yaml
image:
registry: harbor.local:5050 #로컬 Harbor 주소로 변경 필요
repository: prometheus/kube-state-metrics
tag: "v2.6.0"
* If you need to limit the collection metrics
If you need to limit the collected metrics due to PVC capacity restrictions, you should additionally change the values below in values.yaml.
kubelet:
serviceMonitor:
enabled: false #kubelet default job 제외 처리
prometheusOperator:
serviceMonitor:
selfMonitor: false #prometheus-operator default job 제외 처리
prometheus:
serviceMonitor:
selfMonitor: false #prometheus default job 제외 처리
prometheusSpec:
additionalScrapeConfigs:
- job_name: "node-exporter-custom"
kubernetes_sd_configs:
- role: endpoints
namespaces:
names: ["cattle-monitoring-system"]
relabel_configs:
- source_labels: [__meta_kubernetes_namespace]
regex: cattle-monitoring-system
action: keep
- source_labels:
[__meta_kubernetes_service_label_app_kubernetes_io_name]
regex: prometheus-node-exporter
action: keep
- source_labels: [__meta_kubernetes_endpoint_port_name]
regex: http-metrics
action: keep
- source_labels: [__meta_kubernetes_endpoint_address_target_kind]
regex: Pod
action: keep
- source_labels: [__meta_kubernetes_pod_node_name]
target_label: instance
action: replace
metric_relabel_configs:
- source_labels: [__name__]
regex: node_uname_info|node_cpu_seconds_total|node_load1|node_load5|node_load15|node_memory_MemTotal_bytes|node_memory_MemAvailable_bytes|node_memory_Active_bytes|node_memory_.*|node_filesystem_(size|avail|free|used)_bytes|node_network_(receive|transmit)_bytes_total
action: keep -
-
Packaging the modified kube-prometheus-stack Helm Chart
helm package kube-prometheus-stack # kube-prometheus-stack-69.8.2.tgz 형식의 패키지 파일 생성 -
Generated Docker Image file and
prometheus-operator-crds,kube-prometheus-stack Helm ChartCopy to the build server -
Creating a Project in Local Harbor Using the Harbor Web UI
Project Name: prometheusAccess Level: Public
-
Load & Push Docker Image to Local Harbor on the Build Server
# prometheus
docker load -i prometheus.tar
docker push harbor.local:5050/prometheus/prometheus:v3.2.1
# prometheus-operator
docker load -i prometheus-operator.tar
docker push harbor.local:5050/prometheus/prometheus-operator:v0.80.1
# prometheus-node-exporter
docker load -i node-exporter.tar
docker push harbor.local:5050/prometheus/prometheus-node-exporter:v1.9.0
# prometheus-config-reloader
docker load -i prometheus-config-reloader.tar
docker push harbor.local:5050/prometheus/prometheus-config-reloader:v0.59.1
# kube-state-metrics
docker load -i kube-state-metrics.tar
docker push harbor.local:5050/prometheus/kube-state-metrics:v2.6.0 -
Setting up Prometheus CRDs Removing existing Prometheus CRDs
# CRD 조회
kubectl get crd | grep monitoring.coreos.com
# 위 명령어 실행 결과로 나온 CRD 삭제
kubectl delete crd <CRD 명>After removing the CRD, install the CRD using the copied CRDs Helm chart.
# Namespace : cattle-monitoring-system
# ReleaseName : prometheus
helm install prometheus-operator-crds prometheus-operator-crds-20.0.0.tgz -n cattle-monitoring-system --create-namespace -
Installing Prometheus
# Namespace : cattle-monitoring-system
# ReleaseName : prometheus
helm install prometheus kube-prometheus-stack-69.8.2.tgz -n cattle-monitoring-system --create-namespaceIf you need to limit the collection metrics, you must run the following command to stop the basic metric collection.
kubectl delete servicemonitor prometheus-prometheus-node-exporter -n cattle-monitoring-system
kubectl delete servicemonitor prometheus-kube-state-metrics -n cattle-monitoring-system
Installation and Uninstallation
If you need to uninstall Prometheus, you can do so using the following command.
helm uninstall prometheus -n cattle-monitoring-system
Additional Settings
Management Center configMap settings
To use the system monitoring feature of the management center, the configMap values of the management center frontend/backend must be set correctly.
-
Security365 Management Center Frontend configMapVUE_APP_USE_SYSTEM_MONITORING: Whether to use system monitoring feature
### portal-web-config
VUE_APP_USE_SYSTEM_MONITORING: true -
Security365 Management Center Backend configMapCUSTOM_PROMETHEUS_URL: Internal address of the Prometheus service cluster
### cloud-spsvr-config
CUSTOM_PROMETHEUS_URL: http://rancher-monitoring-prometheus.cattle-monitoring-system.svc.cluster.local:9090